package test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial")
public class SDGController extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
try {
//URL url = new URL("http://logos.cs.umbc.edu:8080/swoogle31/q?queryType=search_swd_ontology&searchString=service&key=demo");
	URL url = new URL("http://watson.kmi.open.ac.uk/API/semanticcontent/keywords/?q=service"); 
	BufferedReader reader = new BufferedReader(new
InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) {
resp.getOutputStream().println(line);
}
reader.close();
} catch (MalformedURLException e) {
	resp.getOutputStream().println(e.getMessage());
	} catch (IOException e) {
	resp.getOutputStream().println(e.getMessage());
	}
	}
	}
